<%@page errorPage="/pages/error.jsp" contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%--
    This file is an entry point for JavaServer Faces application.
--%>
<f:view locale="#{languagesBean.locale}">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title><h:outputText value="#{lang.loginTitle}" /></title>
        </head>
        <body>
            <jsp:include page="/pages/header.jsp"/>
            <%--<% String s = null; out.println(s.trim()); %>--%>
            <a4j:form>
                
                <rich:panel header="#{lang.loginLogin}" style="width:250px; height:200px; text-align:center; margin-left:auto; margin-right:auto;">
                   
                    <h:outputText value="#{lang.loginUsername} " />
                    <h:inputText value="#{user.username}"/>
                    <br>
                    
                    <h:outputText value="#{lang.loginPassword}" />
                    <h:inputSecret value="#{user.password}"/>
                    <br>
                    
                    <h:selectOneMenu id="type" value="#{user.type}">
                        <f:selectItem id="choose1" itemLabel="#{lang.loginPatient}" itemValue="PATIENT" />
                        <f:selectItem id="choose2" itemLabel="#{lang.loginDoctor}" itemValue="DOCTOR" />
                        <f:selectItem id="choose3" itemLabel="#{lang.loginUSL}" itemValue="USL" />
                    </h:selectOneMenu>
                    <br>
                    <a4j:commandButton value="#{lang.loginLogin}" action="#{user.doLogin()}"/>
                    <p>
                    <h:outputText value="#{lang.loginReset}"/>
                    <a4j:commandLink value="#{lang.loginClicHere}" action="reset"/>
                    </p>
                </rich:panel>
            </a4j:form>           
        </body>
    </html>
</f:view>
    